<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <div id="app">
    <!-- <h2>hello world</h2> -->
  </div>

  <script>
    const title = '你好世界'

    // const h2 = document.querySelector('h2')
    // h2.innerText = title

    // ------
    // let h2 = document.createElement('h2')
    // h2.innerText = title
    // document.getElementById('app').appendChild(h2)


    // -------
    let h2 = `<div>
        <h2>${title}</h2>
        <p>${xxx}</p>
      </div>`

    document.getElementById('app').appendChild(h2)

  </script>
</body>
</html>